//
//  SubViewController.m
//  PageSlideDemo
//
//  Created by guopanpan on 13-6-26.
//  Copyright (c) 2013年 guopanpan. All rights reserved.
//

#import "SubViewController.h"

@interface SubViewController ()

@end

@implementation SubViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        
    }
    return self;
}

- (id)initwithPageNumber:(int)page
{
    if (self == [super initWithNibName:@"SubViewController" bundle:nil]) {
        pageNumber = page;
        
        
    }
    
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    pageNumberLabel.text = [NSString stringWithFormat:@"Page%d", pageNumber + 1];
    
    colorArray = [NSMutableArray arrayWithCapacity:10];
    [colorArray addObject:[UIColor redColor]];
    [colorArray addObject:[UIColor greenColor]];
    [colorArray addObject:[UIColor grayColor]];
    [colorArray addObject:[UIColor blackColor]];
    [colorArray addObject:[UIColor blueColor]];
    [colorArray addObject:[UIColor brownColor]];
    [colorArray addObject:[UIColor yellowColor]];
    
    self.view.backgroundColor = [colorArray objectAtIndex:pageNumber];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
